package midalgorithms.math;

public class _02TrailingZeroes {
    public static int trailingZeroes(int n) {
        //  找5的倍数，因为阶乘中2的个数一定多于5
        //  故5的倍数也是末尾0的个数
        int res = 0;
        while (n >= 5){
            res += n/5;
            n /= 5;
        }
        return res;
    }
}
